home *** CD-ROM | disk | FTP | other *** search
/ Total Web Page (Professional Suite) / Total Web Page 99.iso / Javascripts / passwords / pass001_.txt < prev    next >
Text File  |  1998-10-30  |  5KB  |  125 lines

  1. <HTML>
  2. <HEAD>
  3. <TITLE>JavaScript Combination Access Protection</TITLE>
  4.  
  5.  
  6.  
  7. <!-- Cut-N-Paste JavaScript from ISN Toolbox 
  8. Copyright 1996, Infohiway Server Network.  Restricted use is hereby
  9. granted (both personal and commercial use OK so long as this code is 
  10. not *directly* sold), providing this notice is buried somewhere deep
  11. in your HTML document.  A link to http://www.infohiway.com is always 
  12. appreciated, but is absolutely and positively not necessary. :-) -->
  13. <SCRIPT LANGUAGE="JavaScript">
  14. <!--Hide JavaScript from Java-Impaired Browsers
  15. var deO = 0.1232656874742081854;
  16. var de1 = 0.5555555555555555802;
  17. var de2 = "";
  18. var de3 = 81;
  19. var de4 = "";
  20. var de5 = 0;
  21. var de6 = 0;
  22. var de7 = "abcdefghijklmnopqrstuvwxyz";
  23. var ctr = 0;
  24.  
  25. function prtComb() {
  26.   srand();
  27.   de8 = "";
  28.   de8 += rand;
  29.   de9 = de8.substring(3,12);
  30.   de12 = de7.substring(8,9) + de7.substring(13,14) + de7.substring(3,4)
  31.   de12 += de7.substring(4,5) + de7.substring(23,24) + "."
  32.   document.write("<TABLE BORDER=3><TR><TD COLSPAN=3 ALIGN=CENTER>"
  33.    + "<FONT COLOR='blue'><B>Dealer Price List<BR>Combination Lock"
  34.    + "<BR>(Combination changes every time)</B></FONT></TD></TR><TR>");
  35.   for (var i = 0; i < 9; i++) {
  36.     de0 = eval(de9.substring(i,i + 1));
  37.     de0 = ((de0 * 3) - 2)
  38.     if (de0 < 0) {
  39.       de0 = 0;
  40.       }
  41.     de2 += de7.substring(de0,(de0 + 1));
  42.     document.write("<TD ALIGN=CENTER><FONT SIZE = 5><B>"
  43.      + de7.substring(de0,(de0 + 1)) + "</B></FONT></TD>");
  44.     if (i == 2 || i == 5) {
  45.       document.write("</TR><TR>");
  46.       }
  47.     }
  48.   document.write("</TR></TABLE><P><FORM NAME='isnform'><INPUT "
  49.    + "TYPE='text' NAME='cmb' SIZE=9><BR><INPUT TYPE='button' "
  50.    + "NAME='btn' VALUE='Type Combination, then Click Here' "
  51.    + "onClick='confirmBox();'></FORM><P>");
  52.   // Hack to correct floating point/binary conversion problem
  53.   var de10 = 0.0000000001;
  54.   de10 += Math.abs(Math.asin(deO));
  55.   de5 += (de1 * Math.sqrt(de3));
  56.   var de11 = "";
  57.   de11 += de10;
  58.   de11 = de11.substring(2,(de5 + 2));
  59.   for (var i = 0; i < de5; i++) {
  60.     de6 = eval(de11.substring(i,(i + 1))) - 1;
  61.     de4 += de2.substring(de6,(de6 + 1));
  62.     }
  63. }
  64. function srand() {
  65.   // adapted from Stefan Koch's "Introduction to JavaScript" with thanks.
  66.   today = new Date();
  67.   rand = Math.abs(Math.sin(today.getTime()));
  68.  }
  69. function confirmBox() {
  70.   if (document.isnform.cmb.value != de4) {
  71.     ctr ++;
  72.     if (ctr > 2) {
  73.       alert("I'm sorry.  That one's incorrect, too. You're outa here.");
  74.       location.href = "jv_main.html";
  75.       }
  76.     else {
  77.       alert("I'm sorry.  That is incorrect combination number " + ctr + ". Try again");
  78.       }
  79.     }
  80.    else {
  81.      if (confirm("That is the correct Combination. Click OK to proceed to...")) {
  82.        //location.href = de12 + "htm";
  83.     alert("Unmark the above line(in the code) if you use this for 'real'")
  84.       }
  85.     }
  86. }
  87. // -->
  88. </SCRIPT>
  89. </HEAD>
  90. <BODY BGCOLOR="white">
  91.  
  92. <!--Your page goes here and this script to paint to screen is
  93.     placed where you want it to appear in your document. -->
  94. <SCRIPT LANGUAGE="JavaScript">
  95. <!-- Hide from JavaScript-Impaired Browsers
  96. prtComb();
  97.   document.write("<B>The combination for the lock above is now "
  98.    + de4 + ".</B>");
  99.  
  100. // End hiding -->
  101. </SCRIPT>
  102. <P>
  103. <TABLE WIDTH=486 BORDER="0">
  104. <TR><TD><HR NOSHADE></TD></TR>
  105. <TR><TD><B>Here's How the Combination Lock Works:</B>
  106. <P>The combination is a pattern rather than a fixed, unchanging password. The letters to be typed change every time the screen is loaded. (Hit your Reload button to verify this) For this example, the pattern is a "T".  But it can be set to any "pattern" you wish. The combination can be seen as 12358 (in that order) in the table below:<P></TD></TR>
  107. </TABLE>
  108. <TABLE BORDER=3>
  109. <TR><TD COLSPAN=3 ALIGN=CENTER><FONT SIZE=4><B>Pattern for Combination<BR>Above Shown in Red</B></FONT></TD></TR>
  110. <TR>
  111. <TD ALIGN=CENTER><FONT COLOR="red" SIZE=4><B>1</B></FONT></TD>
  112. <TD ALIGN=CENTER><FONT COLOR="red" SIZE=4><B>2</B></FONT></TD>
  113. <TD ALIGN=CENTER><FONT COLOR="red" SIZE=4><B>3</B></FONT></TD></TR>
  114. <TR>
  115. <TD ALIGN=CENTER><FONT COLOR="blue" SIZE=4><B>4</B></FONT></TD>
  116. <TD ALIGN=CENTER><FONT COLOR="red" SIZE=4><B>5</B></FONT></TD>
  117. <TD ALIGN=CENTER><FONT COLOR="blue" SIZE=4><B>6</B></FONT></TD></TR>
  118. <TR>
  119. <TD ALIGN=CENTER><FONT COLOR="blue" SIZE=4><B>7</B></FONT></TD>
  120. <TD ALIGN=CENTER><FONT COLOR="red" SIZE=4><B>8</B></FONT></TD>
  121. <TD ALIGN=CENTER><FONT COLOR="blue" SIZE=4><B>9</B></FONT></TD></TR>
  122. </TABLE>
  123. <p>
  124. <b>Caution:</b> This will not work on Win3.x machines at present.
  125. <hr>